Certain known bar-code readers rely upon optical sensors which are located a fixed focal length away from the bar code being detected. This may be accomplished by operating a bar-code transducer in contact with the surface upon which the bar code is printed. In other bar code readers, collimated light from a laser is used to scan a bar code on or near a plane of detection. In these and other conventional bar-code readers the object bearing the bar code being detected is usually referenced at a fixed focal distance from the detector in order to pick up a sharp, optical reproduction of an image of the bar code. Also, known bar-code readers commonly require normalizing schemes to assure proper sensing of bar codes that are printed on materials of different background colors and textures, and that are to be detected under varying ambient lighting conditions.
In accordance with the present invention, an improved method and means of operating an optical sensor facilitates the scanning and detection of a bar code located at a random focal distance from the sensor, and under varying lighting and background conditions. Specifically, the effective focal position of an optical system for the present bar code reader is modulated over a selected range of distances to provide both effective background reference conditions and a sharp image of the bar code on the optical detector. Several schemes are provided for modulating the effective focal distance of the optics, and the associated circuitry converts the sensed images to digital signals representative of the detected bar code.